﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using CinemaWS.Model;
using CinemaWS.Repository;
using System.Collections;
using CinemaWS.Model.CustomEntities;

namespace CinemaWS
{
    /// <summary>
    /// Summary description for CinemaService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class CinemaService : System.Web.Services.WebService
    {
        #region Cinema
        [WebMethod(Description = "Get all cinemas")]
        public CinemaEntity[] GetAllCinemas()
        {
            return CinemaRepository.GetAll();
        }

        //[WebMethod(Description = "Get all cinemas by city")]
        //public CinemaEntity[] GetCinemasByCity(string city)
        //{
        //    return CinemaRepository.GetCinemasByCity(city);
        //}

        //[WebMethod(Description = "Get a cinema")]
        //public CinemaEntity GetCinemaDetail(int cinemaID)
        //{
        //    return CinemaRepository.GetDetail(cinemaID);
        //}
        #endregion

        #region Movie
        [WebMethod(Description = "Get all movies in showtime in current day to next 7 days")]
        public MovieEntity[] GetMoviesByCinemaOfShowTimeInCurrentDayToNext7Days()
        {
            return MovieRepository.GetMoviesOfShowTimeInCurrentDayToNext7Days();
        }

        //[WebMethod(Description = "Get all movies of any cinema in showtime in current day to next 7 days")]
        //public MovieEntity[] GetMoviesByCinemaOfShowTimeInCurrentDayToNext7Days(int cinemaID)
        //{
        //    return MovieRepository.GetMoviesByCinemaOfShowTimeInCurrentDayToNext7Days(cinemaID);
        //}

        //[WebMethod(Description = "Get all movies")]
        //public MovieEntity[] GetAllMovies()
        //{
        //    return MovieRepository.GetAll();
        //}

        //[WebMethod(Description = "Get a movie by ID")]
        //public MovieEntity GetDetail(int movieID)
        //{
        //    return MovieRepository.GetDetail(movieID);
        //}
        #endregion

        #region ShowTime
        [WebMethod(Description = "Get all showtimes in showtime in current day to next 7 days")]
        public ShowTimeEntity[] GetAllShowTimeInCurrentDayToNext7Days()
        {
            return ShowTimeRepository.GetAllShowTimeInCurrentDayToNext7Days();
        }

        //[WebMethod(Description = "Get all current showtimes by movie & cinema")]
        //public ShowTimeEntity[] GetShowTimesByCinemaAndMovie(int movieID, int cinemaID)
        //{
        //    return ShowTimeRepository.GetShowTimesByCinemaAndMovie(movieID, cinemaID);
        //}

        //[WebMethod(Description = "Get all showtimes by movie in current date (please get the right format of date)")]
        //public ShowTimeEntity[] GetShowTimeByCurrentDate(string date)
        //{
        //    DateTime dt = Libs.LibConvert.ConvertToDateTime(date);
        //    return ShowTimeRepository.GetShowTimeByCurrentDate(dt);
        //}

        //[WebMethod(Description = "Get a showtime by ID")]
        //public ShowTimeEntity GetShowTimeByID(int showtimeID)
        //{
        //    return ShowTimeRepository.GetDetail(showtimeID);
        //}
        #endregion

        #region TicketInfo

        [WebMethod(Description = "Get all ticketinfo in database")]
        public TicketInfoEntity[] GetAllTicketInfo()
        {
            return TicketInfoRepository.GetAll();
        }

        //[WebMethod(Description = "Get all ticket information of a cinema")]
        //public TicketInfoEntity[] GetAllTicketInfoByCinema(int cinemaID)
        //{
        //    return TicketInfoRepository.GetAllByCinema(cinemaID);
        //}

        //[WebMethod(Description = "Get list of images which have information of a cinema")]
        //public string[] GetImagesOfTicketInfoByCinema(int cinemaID)
        //{
        //    return TicketInfoRepository.GetImagesOfTicketInfoByCinema(cinemaID);
        //}
        #endregion
    }
}
